package week7.springboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.web.bind.annotation.RestController;
import week7.springboot.service.Service1;
import week7.springboot.service.Service2;

@SpringBootApplication
@RestController
public class App {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(App.class, args);


        Service1 service1 = (Service1) context.getBean("service1");

        service1.test();

        Service2 service2 = (Service2) context.getBean("service2");

        service2.test();


    }

}
